package org.adream.account.dao;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.adream.account.entity.RealNameAuthEntity;
import org.adream.account.rest.api.model.DataTableRequest;
import org.apache.ibatis.annotations.Param;

@BaseMybatisDao
public interface RealNameAuthDao {
	
	int addRealNameAuth(RealNameAuthEntity realNameAuth);
	
	int deleteRealNameAuth(RealNameAuthEntity realNameAuth);
	
	int updateRealNameAuth(RealNameAuthEntity realNameAuth);
	
	List<RealNameAuthEntity> queryRealNameAuthsByDr(@Param("dr") Integer dr);
	
	RealNameAuthEntity queryAuthByUidAndDr(@Param("uid") String uid,@Param("dr") Integer dr);
	
	RealNameAuthEntity queryAuthByUid(@Param("uid") String uid);
	
	List<RealNameAuthEntity> queryAuthsBySomeFields(@Param("uid") String uid, @Param("realName") String realName,@Param("creType") Integer creType,
			@Param("state") Integer state,@Param("dr") Integer dr);
	
	int selectCountByCreNum(String creNum);

	int replaceRealNameAuth(RealNameAuthEntity realNameAuth);
	
	//审核"实名认证"
	int checkAuth(RealNameAuthEntity realNameAuth);
	
	//身份证号被哪些个人用户占用 不包括自己
	ArrayList<Map<String, String>> selectByCreNum(@Param("uid")String uid,@Param("creNum")String creNum);
	
	//根据认证图片和删除标志查询认证者
	Set<String> queryUidsByCrePicAndDr(@Param("crePic") String crePic, @Param("dr") Integer dr);

	List<RealNameAuthEntity> queryAuthByDataTable(DataTableRequest dtr);
}